from pydantic import BaseModel, Field
from typing import Optional, List
from datetime import datetime


class DictTypeResponse(BaseModel):
    id: Optional[int] = Field(None, description="类型ID")
    type_code: str
    type_name: str
    type_desc: Optional[str] = None
    # 若启用 TimestampMixin 时间字段，可补充以下两项
    create_time: Optional[datetime] = None
    update_time: Optional[datetime] = None

    class Config:
        from_attributes = True


class DictTypeListResponse(BaseModel):
    total: int = Field(..., description="总数量")
    items: List[DictTypeResponse] = Field(..., description="类型列表")
    page: int = Field(..., description="页码")
    size: int = Field(..., description="每页数量")
    pages: int = Field(..., description="总页数")